export let a = 1

// 类型推论
let arr = [1, 2, 3, 4, 5]


let obj = {
	name: '张三',
	age: 18
}


// let arr1 = [1,2, true, { name: '张三' }, [1,2,3, '123', { age: 18 }, [true, () => {}]]]

// 上下文类型
document.addEventListener('click', e => {
	// e 事件对象
	// e.target 事件源

	// 类型断言: 你确定值的类型
	// 值 as 类型
	const tar = e.target as HTMLElement;


	if (tar.className === 'delete') {
		tar.remove()
	}

	if (tar.className === 'add') {
		tar.classList.add('active')
	}
})


	